package sj.System.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import sj.System.dao.role.RoleMapper;
import sj.System.pojo.SysRole;

public class RoleMapperImpl implements RoleMapper {

    private SqlSessionTemplate sqlSession;
    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    /**
     * 根据ID修改角色信息
     *
     * @param role
     * @return
     */
    @Override
    public int updateRole(SysRole role) {
        return sqlSession.update("sj.System.dao.role.RoleMapper.updateRole",role);
    }

    /**
     * 根据角色id删除
     *
     * @param id
     * @return
     */
    @Override
    public int delRole(Integer id) {
        return sqlSession.update("sj.System.dao.role.RoleMapper.delRole",id);
    }

}
